﻿{% if user.is_authenticated %}
<form id="logoutForm" action="/logout" method="post" class="nav-right">
    {% csrf_token %}
    <ul class="nav-right ">
        <li><a >{{ user.username }} </a></li>
        <li><a href="javascript:document.getElementById('logoutForm').submit()">注销</a></li>
    </ul>

</form>

{% else %}

<ul>
    <li><a href="{% url 'login' %}" target="_blank">登录</a></li>
</ul>

{% endif %}
